﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace B.WMS.Migrations
{
    /// <inheritdoc />
    public partial class rtgf : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "GoodsId",
                table: "WMSGoods");

            migrationBuilder.RenameColumn(
                name: "Unit",
                table: "WMSUnits",
                newName: "Unitscoding");

            migrationBuilder.RenameColumn(
                name: "WGoodstypeid",
                table: "WMSGoodstype",
                newName: "Goodstypecoding");

            migrationBuilder.CreateTable(
                name: "WMSWAllocate",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "uuid", nullable: false),
                    WAllocatecoding = table.Column<string>(type: "text", nullable: false),
                    WAllocatename = table.Column<string>(type: "character varying(20)", maxLength: 20, nullable: false),
                    WAllocatetime = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
                    Specificationmodel = table.Column<string>(type: "text", nullable: false),
                    Unitid = table.Column<string>(type: "text", nullable: false),
                    Goodstypeid = table.Column<string>(type: "text", nullable: false),
                    Barcode = table.Column<string>(type: "text", nullable: false),
                    Pullid = table.Column<string>(type: "text", nullable: false),
                    Tuneinid = table.Column<string>(type: "text", nullable: false),
                    Tunequantity = table.Column<int>(type: "integer", nullable: false),
                    Tuneprice = table.Column<decimal>(type: "numeric", nullable: false),
                    Pullquantity = table.Column<int>(type: "integer", nullable: false),
                    Pullprice = table.Column<decimal>(type: "numeric", nullable: false),
                    Pullstuts = table.Column<string>(type: "text", nullable: false),
                    Tunestuts = table.Column<string>(type: "text", nullable: false),
                    Purchaseperson = table.Column<string>(type: "text", nullable: false),
                    Listperson = table.Column<string>(type: "text", nullable: false),
                    ExtraProperties = table.Column<string>(type: "text", nullable: false),
                    ConcurrencyStamp = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: false),
                    CreationTime = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
                    CreatorId = table.Column<Guid>(type: "uuid", nullable: true),
                    LastModificationTime = table.Column<DateTime>(type: "timestamp without time zone", nullable: true),
                    LastModifierId = table.Column<Guid>(type: "uuid", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_WMSWAllocate", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "WMSWVendor",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "uuid", nullable: false),
                    WVendorcoding = table.Column<string>(type: "text", nullable: false),
                    WVendorname = table.Column<string>(type: "character varying(20)", maxLength: 20, nullable: false),
                    WVendorindustry = table.Column<string>(type: "text", nullable: false),
                    WVendorGoods = table.Column<string>(type: "text", nullable: false),
                    WVendorMoney = table.Column<decimal>(type: "numeric", nullable: false),
                    WVendorCount = table.Column<int>(type: "integer", nullable: false),
                    WVendortype = table.Column<string>(type: "text", nullable: false),
                    WVendorperson = table.Column<string>(type: "text", nullable: false),
                    WVendorphone = table.Column<string>(type: "text", nullable: false),
                    WVendoremail = table.Column<string>(type: "text", nullable: false),
                    Department = table.Column<string>(type: "text", nullable: false),
                    Address = table.Column<string>(type: "text", nullable: false),
                    Accountname = table.Column<string>(type: "text", nullable: false),
                    Taxpayer = table.Column<string>(type: "text", nullable: false),
                    Bankaccount = table.Column<string>(type: "text", nullable: false),
                    Bank = table.Column<string>(type: "text", nullable: false),
                    Bankaddress = table.Column<string>(type: "text", nullable: false),
                    ExtraProperties = table.Column<string>(type: "text", nullable: false),
                    ConcurrencyStamp = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: false),
                    CreationTime = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
                    CreatorId = table.Column<Guid>(type: "uuid", nullable: true),
                    LastModificationTime = table.Column<DateTime>(type: "timestamp without time zone", nullable: true),
                    LastModifierId = table.Column<Guid>(type: "uuid", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_WMSWVendor", x => x.Id);
                });
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "WMSWAllocate");

            migrationBuilder.DropTable(
                name: "WMSWVendor");

            migrationBuilder.RenameColumn(
                name: "Unitscoding",
                table: "WMSUnits",
                newName: "Unit");

            migrationBuilder.RenameColumn(
                name: "Goodstypecoding",
                table: "WMSGoodstype",
                newName: "WGoodstypeid");

            migrationBuilder.AddColumn<string>(
                name: "GoodsId",
                table: "WMSGoods",
                type: "text",
                nullable: false,
                defaultValue: "");
        }
    }
}
